#ifndef STX_ALGORITHM_CONTAINS_HPP
#define STX_ALGORITHM_CONTAINS_HPP

#include <stx/algorithm/common.hpp>
#include <stx/algorithm/find.hpp>

namespace stx {

template<class InputIterator, class T>
inline bool
contains(InputIterator first, InputIterator last, const T& value)
{
    return (stx::find(first, last, value) != last);
}

template<class Container, class T>
inline bool
contains(const Container& c, const T& value)
{
    return stx::contains(stx::begin(c), stx::end(c), value);
}

template <class InputIterator, class Predicate>
inline bool
contains(stx::iterator_range<InputIterator> r, Predicate pred)
{
    return contains(stx::begin(r), stx::end(r), pred);
}

} // namespace stx

#endif // STX_ALGORITHM_CONTAINS_HPP
